<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <ui:composition template="layout.xhtml">

        <ui:define name="corpo">
            <h:form id="incluir_form_ato" acceptcharset="utf-8">
                 <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexEmolumento.xhtml')}" value="Emolumento" update="@form" immediate="true"/> >
                    <p:commandLink  value="Visualizar Emolumento" update="@form" immediate="true"/>
                </div>
                <p:panel header="Visualizar Emolumento">
                    <p:growl showDetail="true"  id="msg" />
                    <fieldset>
                        <legend>Dados do Emolumento</legend>
                        
                        <h:panelGrid  columns="2"  id="entrada" styleClass="textAlignRight" columnClasses="textAlignRight"> 
                            <h:outputText value="Descrição :" style="font-weight: bold;"/>
                            <h:outputText id="desc_emol" value="#{managerVisualizarEmolumento.emolumentoVisulizar.descricao}"/>
                            <h:outputText value="Data Vigor:" style="font-weight: bold;"/>
                            <h:outputText value="#{managerVisualizarEmolumento.emolumentoVisulizar.datVigor}">
                                <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss"/>
                            </h:outputText>
                            <h:outputText value=""/>
                        </h:panelGrid>
                    </fieldset>
                    <br/>
                    <fieldset>
                        <legend>Itens do Emolumento</legend>
                        <h:panelGrid  columns="2"  id="e" styleClass="textAlignRight" columnClasses="textAlignRight"> 
                             
                       
                        </h:panelGrid>      
                        <p:dataTable value="#{managerVisualizarEmolumento.emolumentoItens}" var="tra"
                                 paginator="true" rows="20"
                                 paginatorPosition="bottom"
                                 rowKey="#{tra.id}" selectionMode="single"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                 rowsPerPageTemplate="5,10,15">    

                        <f:facet name="header">  
                            Todos Atos Cadastrados 
                        </f:facet>
                             <p:column headerText="Ato">
                                 <h:outputText value="#{tra.atoItem.descricao} #{tra.valInicial eq null ? '' : '( ' }#{tra.valInicial eq null ? '': tra.valInicial.toString().concat(' a ')} #{tra.valFinal}#{tra.valInicial eq null ? '' : ' )' }" />  
                             </p:column>
                             <p:column headerText="Cartório">
                                  <h:outputText value="#{tra.cartorio eq 0.0 ? '-': tra.cartorio}" style="float:right;"/>  
                             </p:column>
                             <p:column headerText="Fermojupi">
                                 <h:outputText value=" #{tra.fermojupi eq 0.0 ? '-': tra.fermojupi}" style="float:right;"/>  
                             </p:column>
                             <p:column headerText="Valor">
                                 <h:outputText value="#{tra.valor eq 0.0 ? '-': tra.valor}" style="float:right;"/>  
                             </p:column>
                             <p:column headerText="OAB">
                                 <h:outputText value="#{tra.oab ? 'SIM' : 'NÃO'}" style="color: #{tra.oab ? 'green':'red'}; font-weight:bold;"/>  
                             </p:column>
                         </p:dataTable>
                    </fieldset>
                      <center>
                          <p:commandButton id="limpar" icon="ui-icon-arrowreturnthick-1-w" value="Voltar" actionListener="#{managerEmolumento.redirect('indexEmolumento.xhtml')}" immediate="true" />
                    </center>   
                </p:panel>
                
            </h:form>
        </ui:define>
    </ui:composition>

</html>

